package com.woniuxy.controller;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.entity.RbacPerm;
import com.woniuxy.entity.RbacRole;
import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.RbacRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.management.relation.Role;
import java.util.List;

/**
 * @author: wgt
 * Date: 2021/11/28:19:01
 * Description:
 */
@RestController
@RequestMapping("/role")
public class RbacRoleController {
    @Autowired
    RbacRoleService rbacRoleService;
    @RequestMapping("/findAll")
    public PageInfo<RbacRole> findAll(@PathVariable int pageNum, @PathVariable int pageSize){
       return rbacRoleService.findAll(pageNum,pageSize);


    }
    @RequestMapping("/save")
    public ResponseEntity save(@RequestBody RbacRole rbacRole){

        return  rbacRoleService.save(rbacRole);

    }
    @RequestMapping("/delete")
    public ResponseEntity delete( int id){

        return  rbacRoleService.deleteById(id);

    }
    @RequestMapping("/update")
    public ResponseEntity update(@RequestBody RbacRole rbacRole){

        return  rbacRoleService.update(rbacRole);

    }

}
